import {
  getOemDictList,
  updateDictList,
  recoverySingleById,
  checkOemDict,
  saveOemDict,
  updateByStationId,
  upSorOem,
  downSortOem,
  getOemDictId,
  oemFindType,
} from '../services/dictionary';
import { Request } from '../common/Request';

const modelRequest = new Request([
  {
    type: 'getOemDictList',
    requestWay: getOemDictList,
  },
  {
    type: 'oemFindType',
    requestWay: oemFindType,
  },
  {
    type: 'getOemDictId',
    requestWay: getOemDictId,
  },
  {
    type: 'updateDictList',
    requestWay: updateDictList,
  },
  {
    type: 'recoverySingleById',
    requestWay: recoverySingleById,
  },
  {
    type: 'checkOemDict',
    requestWay: checkOemDict,
  },
  {
    type: 'saveOemDict',
    requestWay: saveOemDict,
  },
  {
    type: 'updateByStationId',
    requestWay: updateByStationId,
  },
  {
    type: 'upSorOem',
    requestWay: upSorOem,
  },
  {
    type: 'downSortOem',
    requestWay: downSortOem,
  },
]);

export default {
  namespace: 'OemDict',

  state: {},

  effects: modelRequest.effects,
  reducers: modelRequest.reducer,
};
